﻿using System.Collections.Generic;
using System.ServiceModel;
using Cubicle.Core.DataContracts;

namespace Cubicle.Core.Interfaces
{
    [ServiceContract(
        SessionMode = SessionMode.Allowed, 
        Namespace = "http://www.cubicle.co.uk/",
        Name = "IEngine")]
    //[ServiceKnownType("GetKnownTypes", typeof(KnownTypeProvider))]
    public interface IReflectionEngine
    {

        [OperationContract]
        bool GetLoadRunnerState();

        [OperationContract]
        string GetVersion();

        [OperationContract]
        void SetLoadRunnerState(bool state);

        [OperationContract]
        IEnumerable<string> GetLog(int i);

        [OperationContract]
        string GetId();

        [OperationContract]
        Dictionary<string, string> GetHandleTypes();

        [OperationContract]
        Dictionary<string, string> GetMetaDataTypes(string handle);

        [OperationContract]
        List<MemberData> GetMembers(string handle);

        [OperationContract]
        IEnumerable<AssemblyData> GetAssemblyDetails();

        [OperationContract]
        TypeData GetTypeData(string target);

        [OperationContract]
        List<TypeData> GetTypes(string fullname);

        [OperationContract]
        List<MethodData> GetMethods(string target);

        [OperationContract]
        List<FieldData> GetFields(string target);

        [OperationContract]
        List<PropertyData> GetProperties(string target);

        [OperationContract]
        List<ConstructorData> GetConstructors(string target);

        [OperationContract]
        List<ParameterData> GetParameterData(string target, string methodName, int offset = 0);

        [OperationContract(IsOneWay = true)]
        void RemoveHandle(string handle);

        [OperationContract]
        string LoadAssembly(byte[] assembly, byte[] symbols = null);

    }
}
